package ClassLoader;

import ClassLoader.classloader.FileSystemClassLoader;

/**
 * @author dycong
 * @date 2018/3/6 12:50
 */
public class ClassLoaderTree {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        ClassLoader loader = ClassLoaderTree.class.getClassLoader();
        while (null != loader){
            System.out.println(loader.toString());
            loader = loader.getParent();
        }


        String path = "E:\\samething\\zooMonitor\\target\\classes";
        String className = "com.samething.cardniu.monitor.EmailUtil";
        FileSystemClassLoader fileSystemClassLoader = new FileSystemClassLoader(path);

        Class c = fileSystemClassLoader.loadClass(className);
        System.out.println(c);
        Object o = c.newInstance();
        System.out.println(o);
    }
}
